home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Libraries / Core / Includes / UPointerObject.h < prev    next >
Encoding:
Text File  |  1996-04-03  |  2.2 KB  |  72 lines  |  [TEXT/MPS ]

  1. // UPointerObject.h 
  2. // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
  3.  
  4. #ifndef __UPOINTEROBJECT__
  5. #define __UPOINTEROBJECT__
  6.  
  7. // MacApp
  8.  
  9. #ifndef __MACONDITIONALMACROS__
  10. #include "MAConditionalMacros.h"
  11. #endif
  12.  
  13. // Toolbox
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. #endif
  18.  
  19. // ANSI
  20.  
  21. #ifndef __STDDEF__
  22. #include <stddef.h>
  23. #endif
  24.  
  25.  
  26. //----------------------------------------------------------------------------------------
  27. // Forward class declarations
  28. //----------------------------------------------------------------------------------------
  29.  
  30. class TObject;
  31.  
  32. //----------------------------------------------------------------------------------------
  33. // Global function declarations
  34. //----------------------------------------------------------------------------------------
  35.  
  36. void* MAOperatorNew(size_t size);
  37.     // Allocate space for an object in the global object heap. 
  38.  
  39. void MAOperatorDelete(void* obj);
  40.     // Delete an object from the global object heap. 
  41.  
  42. Boolean VerboseIsObject(TObject *obj);
  43.     // Debugging check. Indicate whether the parameter appears to really be an object and
  44.     // emit diagnostics if it is not
  45.  
  46. Boolean AllocateObjectsFromPerm(Boolean allocateFromPerm);
  47.     // Set to true to make object allocation calls use Permanent memory (the default). Set
  48.     // to false to make object allocation calls use temporary memory (if they cannot be
  49.     // allowed to fail). Returns old state.
  50.     
  51. Boolean GetPermObjectAllocationState();
  52.     // Return the state of object allocation.  True for permanent, false for temporary.
  53.  
  54. void FailNonObject(TObject* obj);
  55.     // Invokes failure if parameter is not IsObject
  56.  
  57. TObject* FreeIfObject(TObject* obj);
  58.     // IF obj <> NULL THEN obj->Free; useful for freeing an object that might sometimes be
  59.     // NULL. NULL Function result is handy for assigning back to the reference just freed
  60.     // (to help allieviate dangling pointerciples)
  61.  
  62. void InitUObject();
  63.     // Essential one time initialization for this unit
  64.  
  65. Boolean IsObject(TObject* obj);
  66.     // Debugging check. Returns true if obj references something that looks like a real
  67.     // object, false if obj is NULL or a non-object reference. This is not an absolutely
  68.     // sure-fire test of objectness. When debugging is off, it is just a check if the
  69.     // reference is not NULL. 
  70.  
  71. #endif
  72.